
package org.apache.osgimaker.analyse.algorithm.dependency;

import java.util.Arrays;

import org.apache.osgimaker.analyse.algorithm.graph.AtomicVertex;



public class ShowStatement implements Statement
{
  private final ResultRenderer _renderer;
  private final Preference[] _preferences;
  
  public ShowStatement(ResultRenderer renderer, Preference[] preferences)
  {
    _renderer = renderer;
    _preferences = preferences;
  }

  public Result execute(AtomicVertex[] graph)
  {
    for (int i = 0; i < _preferences.length; i++)
    {
      _renderer.considerPreference(_preferences[i]);
    }
    return _renderer.getDescriptionOfCurrentPreferences();
  }

  public String toString()
  {
    return Arrays.asList(_preferences).toString();
  }
}
